/*
 * addon_command.h
 *
 *  Created on: 2010-1-7
 *      Author: gavinkwoe
 */

#ifndef ADDON_STRUCT_H_
#define ADDON_STRUCT_H_

#include "addon_features.h"
#include "addon_std.h"

/*************************************************************************
* MACROS
*************************************************************************/

#define MAX_PREFACE_LEN		(32)
#define MAX_CONTENT_LEN		(32)

/*************************************************************************
* DECLARETION
*************************************************************************/

struct __struct_addon_preface;
typedef struct __struct_addon_preface		addon_preface_t;
typedef struct __struct_addon_preface *		addon_preface_ptr_t;

struct __struct_addon_content;
typedef struct __struct_addon_content		addon_content_t;
typedef struct __struct_addon_content *		addon_content_ptr_t;

struct __struct_addon_paragraf;
typedef struct __struct_addon_paragraf		addon_paragraf_t;
typedef struct __struct_addon_paragraf *	addon_paragraf_ptr_t;

struct __struct_addon_bookmark;
typedef struct __struct_addon_bookmark		addon_bookmark_t;
typedef struct __struct_addon_bookmark *	addon_bookmark_ptr_t;

struct __struct_addon_chapter;
typedef struct __struct_addon_chapter		addon_chapter_t;
typedef struct __struct_addon_chapter *		addon_chapter_ptr_t;

/*************************************************************************
* DEFINITION
*************************************************************************/

struct __struct_addon_preface
{
	unsigned long		text_len;
	unsigned short		text_str[ADDON_ROUND_UP_4(MAX_PREFACE_LEN + 1)];
};

struct __struct_addon_content
{
	unsigned long		text_len;
	unsigned short		text_str[ADDON_ROUND_UP_4(MAX_CONTENT_LEN + 1)];
};

struct __struct_addon_paragraf
{
	unsigned long		page_off;
	unsigned long		line_idx;
};

struct __struct_addon_bookmark
{
	unsigned long		percent;
	addon_paragraf_t	paragraf;
	addon_preface_t		preface;
	addon_content_t		content;
};

struct __struct_addon_chapter
{
	addon_paragraf_t	anchor;
	addon_content_t		content;
};

#endif /* ADDON_STRUCT_H_ */
